<extend name="Public/base" />
<block name="head">
<link href="__BOOTSTRAP__/css/bootstrap-datetimepicker.min.css"
	rel="stylesheet" type="text/css">
<link href="__KINDEDITOR__/themes/default/default.css" rel="stylesheet"
	type="text/css">
<link rel="stylesheet" type="text/css"
	href="__STATIC__/uploadify/uploadify.css" />
</block>
<block name="body">
<ul class="breadcrumb">
	<li>
		<a href="javascript:history.back(-1)">返回上一页</a>
		<span class="divider">/</span>
	</li>
	<li class="active">{$meta_title}</li>
</ul>
<div class="row-fluid">
	<form class="form-horizontal" action="{:U('edit')}">
		<input type="hidden" name="id" value="{$info.id|default=''}">
		<div class="control-group">
			<label class="control-label" for="title">内容标题</label>
			<div class="controls">
				<input type="text" id="title" name="title" class="span8"
					placeholder="内容标题" value="{$info.title}">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="shorttitle">副标题</label>
			<div class="controls">
				<input type="text" id="shorttitle" name="shorttitle" class="span8"
					placeholder="副标题" value="{$info.shorttitle}">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="copyfrom">来源</label>
			<div class="controls">
				<input type="text" name="copyfrom" id="copyfrom" class="span8"
					value="{$info.copyfrom}" placeholder="来源">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="cid">栏目</label>
			<div class="controls">
				<select id="cid" name="cid" class="span8">
					<volist name="category" id="vo">
					<option value="{$vo.cid}">{$vo.title_show}</option>
					</volist>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="status">状态</label>
			<div class="controls">
				<select id="status" name="status" class="span8">
					<option value="1">启用</option>
					<option value="0">禁用</option>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="commentflag">允许评论</label>
			<div class="controls">
				<select id="commentflag" name="commentflag" class="span8">
					<option value="1">启用</option>
					<option value="0">禁用</option>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="author">作者</label>
			<div class="controls">
				<input type="text" name="author" id="author" class="span8"
					value="{$info.sort|default=session('user_auth.nickname')}"
					placeholder="作者">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="click">点击数</label>
			<div class="controls">
				<input type="text" name="click" id="click" class="span8"
					value="{$info.sort|default=0}" placeholder="点击数">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="publishtime">发布时间</label>
			<div class="controls">
				<input type="text" name="publishtime" id="publishtime" class="span8"
					value="{$info.publishtime}" placeholder="发布时间"
					data-date-format="yyyy-mm-dd hh:ii" readonly>

			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="content">内容</label>
			<div class="controls">
				<textarea rows="3" name="content" id="content" class="span8"
					placeholder="内容">{$info.content}</textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="keywords">关键字</label>
			<div class="controls">
				<textarea rows="3" name="keywords" id="keywords" class="span8"
					placeholder="关键字">{$info.keywords}</textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="description">摘要描述</label>
			<div class="controls">
				<textarea rows="3" name="description" id="description" class="span8"
					placeholder="摘要描述">{$info.description}</textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="att">附件</label>
			<div class="controls">
				<input id="att" name="att" type="file" multiple="true" class="span8">
			</div>
		</div>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn ajax-post"
					target-form="form-horizontal">保存</button>
				<button type="button" class="btn"
					onclick="javascript:history.back(-1)">取消</button>
			</div>
		</div>
	</form>
</div>
</block>
<block name="script"> <script type="text/javascript"
	src="__BOOTSTRAP__/js/bootstrap-datetimepicker.min.js">
</script> <script type="text/javascript"
	src="__BOOTSTRAP__/js/bootstrap-datetimepicker.zh-CN.js"></script> <script
	charset="utf-8" src="__KINDEDITOR__/kindeditor-min.js"></script> <script
	charset="utf-8" src="__KINDEDITOR__/lang/zh_CN.js"></script> <script
	type="text/javascript"
	src="__STATIC__/uploadify/jquery.uploadify.min.js"></script> <script
	type="text/javascript">
$('#publishtime').datetimepicker({ language:'zh-CN'}); 
setValue("pid", {$info.pid|default=0}); 
setValue("status", {$info.status|default = 1}); 


var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="content"]', {
		allowFileManager : true
	});

});

/* $(function() {
    $('#att').uploadify({
    	'buttonClass':'btn btn-mini',//为上传按钮添加类名。
    	'buttonText':'选择文件',//定义显示在默认按钮上的文本。
    	 'multi'        : true,//是否多文件上传
    	 'fileExt': '{:C('FILEEXT')}',//可上传的文件类型
    	'auto'        : true,//自动上传
    	'method':'post',//上传文件的提交方法，取值'post'或'get'
    	'progressData':'percentage',//设置显示在上传进度条中的数据类型，可选项时百分比（percentage）或速度（speed）
    	'fileSizeLimit':{:C('FILESIZELIMIT')} * 1000000,//限制上传文件的大小2m(比特b)
        'swf'      : '__STATIC__/uploadify/uploadify.swf',    //指定上传控件的主体文件
        'uploader' : '__STATIC__/uploadify/uploadify.php'    //指定服务器端上传处理文件
        //其他配置项
    });
}); */

</script> </block>
